<?php
/**
 * @filename TestDir.php
 * @author LD King
 * @encoding UTF-8
 * @date 2008-9-11 | 上午12:09:12
 * @package 
 * @subpackage 
 * @usage 测试遍历目录
 * @note 
 * @copyright Copyright (c) 2007 - 2008 LD (http://mifunny.info)
 * @version $Id: $
 */

$dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('/home/http/mifunny'), true);

$num = 0;
$size = 0;
foreach ($dir as $key => $value) {
	if (is_dir($value)) { 
		echo str_repeat('|─', $dir->getDepth()).$value.'<br />';
		echo 'File Size: '.filesize($value).'kB<br />';
	}
	$size += filesize($value);
	$num++;
}

echo "<br /> _____  num: ".$num.'<br /> ______ Size: '.$size/pow(1024, 2);

?>